var Vid2C = new Object();
Vid2C.rev                = 5;
Vid2C.SearchDesc         = 'Search on Vid2c';
Vid2C.Name               = 'Vid2C';
Vid2C.Search             = function (keyword, page){
  var result = new Object();
  result.bypage            = 24;
  result.start             = (page-1)*result.bypage+1;
  c = GetContents('http://www.vid2c.com/search?search_query='+escape(keyword)+'&search_type=videos&page='+page);
  switch (keyword) {
    case '#best':
    c = GetContents('http://www.vid2c.com/search?search_type=videos&o=tr&page='+page);
    break;
    case '#news':
    c = GetContents('http://www.vid2c.com/search?search_type=videos&o=mr&page='+page);
    break;
    case '#views':
    c = GetContents('http://www.vid2c.com/search?search_type=videos&o=mv&page='+page);
    break;
  }
  result.total             = ext(' of <span>')
  result.VideoInfo = new Array();
  if (page == 1){
    video = new Object();
    video.attr          = 1;
    video.Title         = 'GoTube info';
    video.Description   = "You can search #best, #news or #views for find the best, the news \n or the most viewed videos on this site.";
    video.Tags          = '#best #news #views';
    result.VideoInfo.push(video);
  }
  while (p = c.indexOf('<div class="video_box">',p)+1){
    video = new Object();
    video.attr          = 3;
    video.page          = 'http://www.vid2c.com'+ext('href="');
    video.Title         = ext('bold">');
    video.ThumbnailURL  = ext('src="');
    video.Description   = ext('alt="');
    video.LengthSeconds = ext('"box_left">',':')*60+ext(':','<')*1;
    video.ViewCount     = ext('<div class="clear_right"></div>',' ').replace(/\s+/g,'')*1;
    video.URL           = 'unescape(GetContents("'+video.page+'").match("%26file=(.*?)%26t=")[1])';
    result.VideoInfo.push(video);
  }
  result.end          = result.start-1+result.VideoInfo.length;
  return result;
}
SiteList.push(Vid2C);